Ultimate Compression
What if there was a compression format that is sort of like a Paint program? This kind of compression uses "opcodes" (represented as a series of bits, ''and ''bitpacked), similar to 6502 opcodes. Each opcode does one of many different things. The Accumulator ("A") can be thought of as a single tile. There is also an index register ("X") that tells what tile you want you are operating on. The tile in the Accumulator has the following indices for each pixel. This is the "base index matrix." Some instructions have this kind of matrix, since it would take much less space. Every index matrix is stored as 48 bytes. Every set of 6 bytes defines one row, and each row is composed of eight 6-bit values that determine the pixel indices. FHO - Flip Horizontal This reverses every row of the tile. FHO - Flip Vertical This reverses every column of the tile. FHV - Flip Horizontal and Vertical This reverses every row ''and ''column of the tile. MD1 - Mirror Diagonally 1 This reflects the tile about the diagonal that runs from the upper-left to the lower-right. The upper-right half is mirrored the the lower-left half. The index matrix for the tile becomes: MD2 - Mirror Diagonally 2 This reflects the tile about the diagonal that runs from the upper-left to the lower-right. The lower-left half is mirrored the the upper-right half. The index matrix for the tile becomes: MD3 - Mirror Diagonally 3 This reflects the tile about the diagonal that runs from the upper-right to the lower-left. The upper-left half is mirrored the the lower-right half. MD4 - Mirror Diagonally 4 This reflects the tile about the diagonal that runs from the upper-right to the lower-left. The lower-right half is mirrored the the upper-left half. M2W - Mirror 2-Way Input: *2-bit: Which way to mirror **00: Left --> right **01: Right --> left **10: Top --> bottom **11: Bottom --> top Mirrors half the tile any which way you want. M4W - Mirror 4-Way Input: *2-bit: Which corner to mirror **00: Upper-left **01: Upper-right **10: Lower-left **11: Lower-right Mirrors a quarter of the tile any which way you want. ROU - Rotate Up ROD - Rotate Down ROL - Rotate Left ROR - Rotate Right ASU - "Arithmetic" Shift Up ASD - "Arithmetic" Shift Down ASL - "Arithmetic" Shift Left ASR - "Arithmetic" Shift Right LSU - "Logical" Shift Up Shifts a tile up one pixel. The vacant row is filled with pixels of color #0. LSD - "Logical" Shift Down Shifts a tile down one pixel. The vacant row is filled with pixels of color #0. LSL - "Logical" Shift Left Shifts a tile left one pixel. The vacant column is filled with pixels of color #0. LSR - "Logical" Shift Right Shifts a tile right one pixel. The vacant column is filled with pixels of color #0. FSU - Fill Shift Up Input: *4-bit: Value Shifts a tile up one pixel. The vacant row is filled with pixels of the specified color. FSD - Fill Shift Down Input: *4-bit: Value Shifts a tile down one pixel. The vacant row is filled with pixels of the specified color. FSL - Fill Shift Left Input: *4-bit: Value Shifts a tile left one pixel. The vacant column is filled with pixels of the specified color. FSR - Fill Shift Right Input: *4-bit: Value Shifts a tile right one pixel. The vacant column is filled with pixels of the specified color. ATL - Align Top/Left Performs Align Top followed by Align Left. ATP - Align Top Shifts the tile up until at least one pixel in the top row is opaque. ATR - Align Top/Right Performs Align Top followed by Align Right. ART - Align Right Shifts the tile right until at least one pixel in the far-right column is opaque. ABR - Align Bottom/Right Performs Align Bottom followed by Align Right. ABT - Align Bottom Shifts the tile down until at least one pixel in the bottom row is opaque. ABL - Align Bottom/Left Performs Align Bottom followed by Align Left. ALT - Align Left Shifts the tile left until at least one pixel in the far-left column is opaque. RCL - Rotate 90° Clockwise Rotates the entire tile 90 degrees clockwise. RHF - Rotate 180° Rotates the entire tile 180 degrees. RCC - Rotate 90° Counterclockwise Rotates the entire tile 90 degrees counterclockwise. SWR - Swap Rows SWC - Swap Columns SWX - Swap Pixels LIN - Line Input: *1-bit: Row or Column (0=row, 1=column) *3-bit: Which Row or Column (0-7) *4-bit: Which Color Plots a line in the tile. DLN - Diagonal Line ELN - Edge Line BDR - Border PCR - Corner Pixels CHK - Checkerboard Plots a checkerboard pattern of pixels at even-numbered indices. ICH - Inverse Checkerboard Plots a checkerboard pattern of pixels at odd-numbered indices. D25 - 25% Dither D75 - 75% Dither STP - Store Pixel SHD - Shadow CSH - Common Shadow CLR - Clear Tile IRU - Insert Row Up IRD - Insert Row Down ICL - Insert Row Left ICR - Insert Row Right SDI - Slide Pixel Indices SLD - Slide Pixel Values, not including 0 SLZ - Slide Pixel Values, including 0 AND - Logical AND Input: *4-bit: Value Does a logical AND with every pixel in the tile. ORA - Logical OR Input: *4-bit: Value Does a logical OR with every pixel in the tile. EOR - Logical EOR Input: *4-bit: Value Does a logical XOR with every pixel in the tile. NOT - Logical NOT Does a logical NOT with every pixel in the tile. CSW - Color Swap CPY - Copy Tile into Accumulator INC - Store Tile and Increment Tile Index FLF - Flood Fill Input: *4-bit: Value *6-bit: Pixel Index Does a 4-way flood fill in the tile. A contigous, same-colored region of the tile is replaced with a different color.